'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH RCAPD 8 "Dec 19, 2006"
.SH NAME
rcapd \- resource cap enforcement daemon
.SH SYNOPSIS
.LP
.nf
\fBrcapd\fR [\fB-d\fR]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBrcapd\fR daemon enforces resource caps on collections of processes.
Per-project and per-zone physical memory caps are supported. For information
about projects, see \fBproject\fR(5). For zones information, see \fBzones\fR(7)
.sp
.LP
When the resident set size (RSS) of a collection of processes exceeds its cap,
\fBrcapd\fR takes action and reduces the RSS of the collection.
.sp
.LP
The virtual memory system divides physical memory into segments known as pages.
To read data from a file into memory, the virtual memory system reads in
individual pages. To reduce resource consumption, the daemon can page out, or
relocate, infrequently used pages to an area outside of physical memory.
.sp
.LP
In the \fBproject\fR file, caps are defined for projects that have positive
values for the following project attribute:
.sp
.ne 2
.na
\fB\fBrcap.max-rss\fR\fR
.ad
.RS 16n
The total amount of physical memory, in bytes, that is available to the
project's member processes
.RE

.sp
.LP
See \fBproject\fR(5) for a description of project attributes.
.sp
.LP
For a system with one or more zones, you can dynamically set the
\fBrcap.max-rss\fR value for a zone with \fBrcapadm\fR(8). To set a persistent
cap on memory usage within a zone, you use \fBzonecfg\fR(8).
.sp
.LP
You configure \fBrcapd\fR through the use of \fBrcapadm\fR(8). The daemon can
be monitored with \fBrcapstat\fR(1). Configuration changes are incorporated
into \fBrcapd\fR by sending it \fBSIGHUP\fR (see \fBkill\fR(1)), or according
to the configuration interval (see \fBrcapadm\fR(8)).
.SH OPTIONS
.sp
.LP
The following option is supported:
.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 6n
Enable debug mode. Messages are displayed on the invoking user's terminal.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRSetting Resident Set Size Cap Attribute
.sp
.LP
The following line in the \fB/etc/project\fR database sets an RSS cap of
1073741824 bytes for a project named \fBfoo\fR.

.sp
.in +2
.nf
foo:100::foo,root::rcap.max-rss=10737418240
.fi
.in -2

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB0\fR
.ad
.RS 5n
Successful completion.
.RE

.sp
.ne 2
.na
\fB1\fR
.ad
.RS 5n
An error occurred.
.RE

.sp
.ne 2
.na
\fB2\fR
.ad
.RS 5n
Invalid command-line options were specified.
.RE

.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/project\fR\fR
.ad
.RS 16n
Project database.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
.TE

.SH SEE ALSO
.sp
.LP
.BR rcapstat (1),
.BR svcs (1),
.BR project (5),
.BR attributes (7),
.BR smf (7),
.BR zones (7),
.BR rcapadm (8),
.BR svcadm (8),
.BR zonecfg (8)
.sp
.LP
"Physical Memory Control Using the Resource Capping Daemon" in \fISystem
Administration Guide: Solaris Containers-Resource Management, and Solaris
Zones\fR
.SH NOTES
.sp
.LP
If killed with \fBSIGKILL\fR, \fBrcapd\fR can leave processes in a stopped
state. Use \fBSIGTERM\fR to cause \fBrcapd\fR to terminate properly.
.sp
.LP
A collection's RSS can exceed its cap for some time before the cap is enforced,
even if sufficient pageable memory is available. This period of time can be
reduced by shortening the RSS sampling interval with \fBrcapadm\fR.
.sp
.LP
The \fBrcapd\fR service is managed by the service management facility,
\fBsmf\fR(7), under the service identifier:
.sp
.in +2
.nf
svc:/system/rcap:default
.fi
.in -2
.sp

.sp
.LP
Administrative actions on this service, such as enabling, disabling, or
requesting restart, can be performed using \fBsvcadm\fR(8). The service's
status can be queried using the \fBsvcs\fR(1) command.
